What you want is COUNT(DISTINCT <expression>) : evaluates expression for each row in a group and returns the number of unique, non-null values. ... <看更多>
Difference between COUNT (*) , COUNT(1), COUNT(Col_Name) and COUNT ( Distinct (Col_Name) in SQLThis is very important SQL Interview Question ... ... <看更多>